import myAxios from "@/request";
import { AxiosResponse } from "axios/index";

export const userRegister = async (
  params: any
): Promise<AxiosResponse<any>> => {
  const res: AxiosResponse<any, any> = await myAxios.request({
    url: "/api/user/register",
    method: "POST",
    data: params || {},
  });
  return res;
};

export const getCurrentUser = async () => {
  return myAxios.request({
    url: "/api/user/current",
    method: "GET",
  });
};
export const userLogin = async (params: any) => {
  return await myAxios.request({
    url: "/api/user/login",
    method: "POST",
    data: params,
  });
};
